clear all

*set working directory
use "data.dta"

*levels of elected political ambition
tab ambition if study==1
tab ambition if study==2

*levels of appointed political ambition
tab appointment if study==1
tab appointment if study==2

*difference between elected and appointed
tab appointdiff if study==1
tab appointdiff if study==2

*Figure 1
hist ambition, d ylab(0(.2).6, labsize(medsmall)) xtitle("") subtitle("Ambition: Elected") xlab(1 `""Not likely" "at all""' 5 `""Extremely" "likely""', labsize(medsmall)) saving(ambhist.gph, replace)
hist appointment, d ylab(0(.2).6, labsize(medsmall)) xtitle("") subtitle("Ambition: Appointed") xlab(1 `""Not likely" "at all""' 5 `""Extremely" "likely""', labsize(medsmall)) saving(apphist.gph, replace)
hist appointdiff, d ylab(0(.2).6, labsize(medsmall)) xtitle("") subtitle("Difference (Appointed - Elected)") xlab(-4(2)4, labsize(medsmall)) saving(diffhist.gph, replace)
graph combine ambhist.gph apphist.gph diffhist.gph, rows(1) ycommon


*Table 1, column 1
svy: reg ambition EC PT PD pidext01 i.inc4miss educ01 male hisp black otherrace age married i.appointtype i.study
est store Elected

*Table 1, column 2
svy: reg appointment EC PT PD pidext01 i.inc4miss educ01 male hisp black otherrace age married i.appointtype i.study
est store Appointed

*Figure 2
coefplot Elected, keep(EC PT PD educ01 pidext01) xline(0) xlab(-1.5(.75)1.5, labsize(medsmall)) ///
	coeflabels(EC =`""Empathic" "Concern""' PT=`""Perspective-" "Taking""' PD=`""Personal" "Distress""' pidext01=`""Partisan" "Strength""' educ01="Education", labsize(medsmall)) /// 
	subtitle("Elected") saving(elected.gph, replace)
coefplot Appointed, keep(EC PT PD educ01 pidext01) xline(0) xlab(-1.5(.75)1.5, labsize(medsmall)) ///
	coeflabels(EC =`""Empathic" "Concern""' PT=`""Perspective-" "Taking""' PD=`""Personal" "Distress""' pidext01=`""Partisan" "Strength""' educ01="Education", labsize(medsmall)) /// 
	subtitle("Appointed") saving(appointed.gph, replace)
graph combine elected.gph appointed.gph

*Table 1, column 3
svy: reg appointdiff EC PT PD pidext01 i.inc4miss educ01 male hisp black otherrace age married i.appointtype i.study
est store diffboth

*Table 1, column 4
reg appointdiff c.EC##i.run PT PD pidext01 i.inc4miss educ01 male hisp black otherrace age married i.appointtype i.study
lincom 1.run#EC + EC
est store intx

